import {Button, Form, Input} from "antd";
import React from "react";

interface MyProfileProps {
    setIsProfileModalVisible: (flag: boolean) => void
}

const MyProfile = (props: MyProfileProps) => {

    const [form] = Form.useForm();

    const handleProfileFormSubmit = (values: any[]) => {
        // 处理表单提交逻辑
        console.log('Profile updated:', values);
        props.setIsProfileModalVisible(false)
    };
    return (<>
        <Form
            form={form}
            layout="vertical"
            onFinish={handleProfileFormSubmit}
        >
            <Form.Item
                name="username"
                label="Username"
                rules={[{required: true, message: 'Please input your username!'}]}
            >
                <Input/>
            </Form.Item>
            <Form.Item
                name="email"
                label="Email"
                rules={[{required: true, type: 'email', message: 'Please input a valid email!'}]}
            >
                <Input/>
            </Form.Item>
            <Form.Item>
                <Button type="primary" htmlType="submit">
                    Save
                </Button>
            </Form.Item>
        </Form>

    </>)
}


export default MyProfile;